package com.Gehaltsrechner;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class Eintraege extends SQLiteOpenHelper
{
	public static final String DATENBANK_DATEI_NAME = "eintraege.db";
	public static final String DATENBANK_NAME = "Eintraege";
	public static int DATENBANK_VERSION = 1;
		
	private static final String create = "CREATE TABLE Eintraege (" 
			+ "ID TNTEGER PRIMARY KEY," 
			+ "Von TEXT NOT NULL," 
			+ "Bis TEXT NOT NULL," 
			+ "Verdienst TEXT NOT NULL);";
	
	
	public Eintraege (Context context)
	{
		super (context,
				DATENBANK_DATEI_NAME,
				null,
				DATENBANK_VERSION);
	}
	

	public void onCreate(SQLiteDatabase db)
	{
		System.err.println("Eintraege:  CREATE");
		db.execSQL (create);
	}


	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
	{
		db.execSQL ("DROP TABLE IF EXISTS " + DATENBANK_NAME + ";");
		onCreate(db);
		DATENBANK_VERSION =1;
	}
}
